<%--@elvariable id="message" type="java.lang.String"--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <title>Leever Expense</title>
    <%@include file="includes/head.jsp"%>
    <link href="<c:url value="/assets/admin/pages/css/login-soft.css"/>" rel="stylesheet" type="text/css"/>
    <script src="<c:url value="/js/bower_components/jquery-backstretch/jquery.backstretch.min.js"/>" type="text/javascript"></script>
</head>
<body class="login">
<div class="logo">
    <a href="<c:url value="/login"/>">
        <img src="<c:url value="/img/llogo-Leever%20.png"/>" alt="" style="height:50px"/>
    </a>
</div>
<div class="menu-toggler sidebar-toggler">
</div>
<div class="content">
<!-- BEGIN LOGIN FORM -->
<form class="login-form" action="<c:url value="/login"/>" method="post">
    <input type="hidden" name="locale" value="zh"/>
    <h3 class="form-title"><spring:message code="loginToYourAccount"/></h3>
    <div class="alert alert-danger display-hide">
        <button class="close" data-close="alert"></button>
			<span><spring:message code="enterAnyUsernameAndPassword"/></span>
    </div>
    <div class="form-group">
        <label class="control-label visible-ie8 visible-ie9"><spring:message code="username"/></label>
        <div class="input-icon">
            <i class="fa fa-user"></i>
            <input class="form-control placeholder-no-fix" type="text" autocomplete="off"
                   placeholder="<spring:message code="username"/>" name="username" id="username" value=""/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label visible-ie8 visible-ie9"><spring:message code="password"/></label>
        <div class="input-icon">
            <i class="fa fa-lock"></i>
            <input id="password" class="form-control placeholder-no-fix" type="password" autocomplete="off"
                   placeholder="<spring:message code="password"/>" name="password" value=""/>
        </div>
    </div>
    <div class="form-actions">
        <label class="checkbox">
            <input type="checkbox" name="remember" value="1"/><spring:message code="rememberMe"/></label>
        <button type="button" id="loginBtn" class="btn blue pull-right"><spring:message code="login"/><i class="m-icon-swapright m-icon-white"></i>
        </button>
    </div>
</form>
<!-- END LOGIN FORM -->
</div>

<div class="copyright">
    Copyright © 2014-2015 Leever Technology Co., Ltd
</div>
</div>
<%@include file="includes/bottomscript.jsp"%>
<script>
    browserValidate();
    function browserValidate() {
        var system = {
            win: false,
            mac: false,
            xll: false
        };
        //检测平台
        var p = navigator.platform;
        system.win = p.indexOf("Win") == 0;
        system.mac = p.indexOf("Mac") == 0;
        system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
        //跳转语句

        if (system.win || system.mac || system.xll) {//转向后台登陆页面
//            alert(!isIE11())
            if (!isIE11() && !isFirefox()) {
                formSub(basePath + "login/loginError")
            }
        }
    }

    function formSub() {
        var $form = $("form");
        if ($form.size() == 0) {
            $("body").wrap('<form method="post"></form>');
            $form = $("form");
        }
        switch (arguments.length) {
            case 0:
                $form.attr("method", "post").submit();
                break;
            case 1:
                $form.attr("method", "post").attr("action", arguments[0]).submit();
                break;
            case 2:
                arguments[0].attr("method", "post").attr("action", arguments[1]).submit();
                break;
        }
    }
    function isIE11() { //ie?
        if("ActiveXObject" in window){
             return !(!!window.ActiveXObject)
        }

        return false
    }

    function isFirefox() {
        return navigator.userAgent.indexOf("Firefox") > 0
    }
</script>
<script src="<c:url value="/js/login.js"/>" type="text/javascript"></script>
<script>
    $(function(){
        Login.init();
        <c:if test="${message!=null}">
            toast.error("${message}");
        </c:if>
    })


</script>
</body>
</html>